import { get, post } from '@/utils/request'

const prefix = 'system'

export default {
  /**
   * 商城链接
   */
  shopLinks: () => {
    return get(`${prefix}/link/shop`)
  },
  /**
   * 商城链接
   */
  sourceLinks: () => {
    return get(`${prefix}/link/source`)
  },
  /**
   * 商城链接
   */
  region: pid => {
    return get(`${prefix}/region/index?pid=${pid}`)
  },
  /**
   * 商城链接
   */
  holiday: data => {
    return get(`${prefix}/holiday/index`, data)
  },
  holidayUpdate: (data, id) => {
    return post(`${prefix}/holiday/update?id=${id || ''}`, data)
  },
  bookRule: () => {
    return get(`${prefix}/rule/index`)
  },
  bookRuleToggle: (data, id) => {
    return post(`${prefix}/rule/update?id=${id || ''}`, data)
  }
}
